package com.eveinfo.api.utils.skilllist;

import java.io.IOException;

import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import com.eveinfo.api.AbstractApiParser;
import com.eveinfo.api.ApiException;
import com.eveinfo.api.NoCacheFoundExecption;

public class SkillsParser extends AbstractApiParser<ApiSkills,SkillListHandler> {
	private static final String SKILLS_URL = "/eve/SkillTree.xml.aspx";

	private static SkillsParser instance;
	
	public static SkillsParser getInstance(){
		if(instance == null){
			instance = new SkillsParser();
		}
		return instance;
	}
	
	private SkillsParser() {
		super(ApiSkills.class, 2, SKILLS_URL);
	}

	public ApiSkills getSkills() throws IOException, SAXException, ParserConfigurationException, ApiException,
			NoCacheFoundExecption {
		SkillListHandler handler = new SkillListHandler();
		return getResponse(handler);
	}

	public static boolean isInstancier() {
		return instance != null;
	}

}